<template>
  <div class="assess">
    <Header></Header>
    <div class="assessMain">
      <p class="current-nav2">
        当前位置 :
        <router-link to="index">首页</router-link>
        <i>></i>
        <a>{{planCompany}}应急预案评审</a>
        <i>></i>
        <a>评审意见汇总</a>
      </p>
      <div class="mianOut">
        <div class="mianInner1">
          <div class="assess-title1">
            <h3>评审意见汇总</h3>
          </div>
          <div class="table_title1">
            形式评审表
            <a v-if="allFlag1" @click="goDetailAll(1,'situationFlag')">形式评审汇总</a>
            <a style="background:#ccc;" v-else>形式评审汇总</a>
          </div>
          <el-table ref="multipleTable" class="mt60" :data="data1">
            <el-table-column type="index" align="center" label="序号" width="150"></el-table-column>
            <el-table-column prop="userName" label="评审专家" align="center" width="200"></el-table-column>
            <el-table-column label="身份" align="center">
              <template slot-scope="scope">{{scope.row.identity =='1' ? '组长' :'组员'}}</template>
            </el-table-column>
            <el-table-column prop="assess" label="形式评审" align="center">
              <template>形式评审表</template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="150">
              <template slot-scope="scope">
                <el-button class="detail-btn" @click="goDetail('1',scope.row.reviewId)">
                  <i class="el-icon-search">查看</i>
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="table_title1">
            要素评审表
            <a v-if="allFlag2" @click="goDetailAll(2,'keyFlag')">要素评审汇总</a>
            <a style="background:#ccc;" v-else>要素评审汇总</a>
          </div>
          <el-table ref="multipleTable" class="mt60" :data="data2">
            <el-table-column type="index" align="center" label="序号" width="150"></el-table-column>
            <el-table-column prop="userName" label="评审专家" align="center" width="200"></el-table-column>
            <el-table-column label="身份" align="center">
              <template slot-scope="scope">{{scope.row.identity =='1' ? '组长' :'组员'}}</template>
            </el-table-column>
            <el-table-column prop="assess" label="要素评审" align="center">
              <template>要素评审表</template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="150">
              <template slot-scope="scope">
                <el-button class="detail-btn" @click="goDetail('2',scope.row.reviewId)">
                  <i class="el-icon-search">查看</i>
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="table_title1">
            附件要素评审表
            <a v-if="allFlag3" @click="goDetailAll(3,'addFlag')">附件要素评审汇总</a>
            <a style="background:#ccc;" v-else>附件要素评审汇总</a>
          </div>
          <el-table ref="multipleTable" class="mt60" :data="data3">
            <el-table-column type="index" align="center" label="序号" width="150"></el-table-column>
            <el-table-column prop="userName" label="评审专家" align="center" width="200"></el-table-column>
            <el-table-column label="身份" align="center">
              <template slot-scope="scope">{{scope.row.identity =='1' ? '组长' :'组员'}}</template>
            </el-table-column>
            <el-table-column prop="assess" label="附件评审" align="center">
              <template>附件评审表</template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="150">
              <template slot-scope="scope">
                <el-button class="detail-btn" @click="goDetail('3',scope.row.reviewId)">
                  <i class="el-icon-search">查看</i>
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="table_title1">
            个人评审意见表
            <a v-if="allFlag4" @click="goDetailAll(4,'ideaPop')">个人评审意见汇总</a>
            <a style="background:#ccc;" v-else>个人评审意见汇总</a>
          </div>
          <el-table ref="multipleTable" :data="data4">
            <el-table-column type="index" align="center" label="序号" width="150"></el-table-column>
            <el-table-column prop="userName" label="评审专家" align="center" width="200"></el-table-column>
            <el-table-column label="身份" align="center">
              <template slot-scope="scope">{{scope.row.identity =='1' ? '组长' :'组员'}}</template>
            </el-table-column>
            <el-table-column prop="assess" label="个人评审" align="center">
              <template>个人评审意见表</template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="150">
              <template slot-scope="scope">
                <el-button class="detail-btn" @click="getDetail2('4',scope.row.userId)">
                  <i class="el-icon-search">查看</i>
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="aBtnBox">
            <input type="button" @click="goNext" value="下一步" />
          </div>
        </div>
      </div>
    </div>
    <Footer />
    <el-dialog title :visible.sync="ideaPop" width="80%">
      <div class="ideaMain">
        <h2 class="ideaTitle">突发事件综合应急预案评审意见表</h2>
        <p class="comName">单位名称：{{companyName}}</p>
        <table class="ideaTable" v-if="detailData5.length>0">
          <colgroup>
            <col width="160px" />
            <col width />
          </colgroup>
          <tr>
            <td>{{detailData5[0].reviewItemOne}}</td>
            <td>
              <strong>{{varname}}</strong>
            </td>
          </tr>
          <tr>
            <td>{{detailData5[1].reviewItemOne}}</td>
            <td></td>
          </tr>
          <tr>
            <td>{{detailData5[2].reviewItemOne}}</td>
            <td>
              <p>
                <span>{{detailData5[0].createTime.split(' ')[0].split('-')[0]+'年'+detailData5[0].createTime.split(' ')[0].split('-')[1]+'月'+detailData5[0].createTime.split(' ')[0].split('-')[2]}}</span>
                日，{{varname}}进行了应急预案专家评审工作。
                <br />评审专家组参照《电力企业应急预案评审与备案细则》，从合法性、完整性、针对性、实用性、科学性、操作性和衔接性等方面，对应急预案的层次结构、语言文字、要素内容、附件项目等进行了系统的审查，并查看了应急预案桌面演练的记录，形成如下评审意见:
              </p>
              <el-input type="textarea" class='addSuggest' v-model="suggestAll"></el-input>
            </td>
          </tr>
          <tr>
            <td>
              评审专家组
              <br />一致认为：
            </td>
            <td>
              <el-input type="textarea" v-model="consensus"></el-input>
            </td>
          </tr>
          <tr>
            <td>评审专家（签字）：</td>
            <td class="sign-word">
              <img v-if="(typeof signImg5) =='string'" :src="signImg1" />
              <img
                v-else
                v-for="item in signImg5"
                :key="item"
                :src="item"
                style="margin-right:10px;"
              />
            </td>
          </tr>
          <tr>
            <td>备注</td>
            <td>
              <el-input type="textarea" v-model="remark5"></el-input>
            </td>
          </tr>
        </table>
        <div class="clearfix">
          <a class="table_save" @click="savePersonAll">保存</a>
        </div>
      </div>
    </el-dialog>
    <el-dialog title :visible.sync="ideaPop2" width="80%">
      <div class="ideaMain">
        <h2 class="ideaTitle">突发事件综合应急预案评审意见表</h2>
        <p class="comName">单位名称：{{companyName}}</p>
        <table class="ideaTable" v-if="detailData4.length > 0">
          <colgroup>
            <col width="160px" />
            <col width />
          </colgroup>
          <tr>
            <td>应急预案名称</td>
            <td>
              <strong>{{varname}}</strong>
            </td>
          </tr>
          <tr>
            <td>应急预案编制人员</td>
            <td></td>
          </tr>
          <tr>
            <td>专家评审意见：</td>
            <td>{{detailData4[0].opinion}}</td>
          </tr>
          <tr>
            <td>评审专家（签字）：</td>
            <td>
              <img v-if="typeof (signImg4)=='string'" :src="signImg4"  />
              <img
                v-else
                v-for="item in signImg4"
                :key="item"
                :src="item"
                style="margin-right:10px;"
              />
            </td>
          </tr>
          <tr>
            <td>备注</td>
            <td>{{detailData4[0].remarks}}</td>
          </tr>
        </table>
      </div>
    </el-dialog>
    <el-dialog title :visible.sync="situationFlag" width="80%">
      <div class="ideaMain">
        <h2 class="ideaTitle ideaTable1">电力企业应急预案形式评审表</h2>
        <table class="ideaTable" v-if="detailData1.length>0">
          <thead>
            <tr>
              <th rowspan="2">评审项目</th>
              <th rowspan="2">评审内容及要求</th>
              <th colspan="3" style="font-weight:800;line-height:30px;">评审意见</th>
            </tr>
            <tr>
              <th style="line-height:30px;">符合</th>
              <th>不符合</th>
              <th>基本符合</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>{{detailData1[0].reviewItemTwo}}</td>
              <td>
                <p>{{detailData1[0].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData1[0].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData1[1].reviewItemTwo}}</td>
              <td>
                <p>{{detailData1[1].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData1[1].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData1[2].reviewItemTwo}}</td>
              <td>
                <p>{{detailData1[2].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData1[2].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td style="width:120px;">{{detailData1[3].reviewItemTwo}}</td>
              <td style="width:300px;">
                <p>{{detailData1[3].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData1[3].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData1[4].reviewItemTwo}}</td>
              <td>
                <p>{{detailData1[4].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData1[4].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData1[5].reviewItemTwo}}</td>
              <td>
                <p>{{detailData1[5].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData1[5].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>评审专家签字</td>
              <td colspan="4" class="sign-word">
                <img v-if="typeof (signImg1)=='string'" :src="signImg1" alt />
                <img
                  v-else
                  v-for="item in signImg1"
                  :key="item"
                  :src="item"
                  style="margin-right:10px;"
                />
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </el-dialog>
    <el-dialog title :visible.sync="keyFlag" width="80%">
      <div class="ideaMain">
        <h2 class="ideaTitle">电力企业综合应急预案要素评审表</h2>
        <table v-if="detailData2.length>0" class="ideaTable ideaTable1">
          <thead>
            <tr>
              <th rowspan="2" colspan="2">评审项目</th>
              <th rowspan="2">评审内容及要求</th>
              <th colspan="3">评审意见</th>
            </tr>
            <tr>
              <th>符合</th>
              <th>不符合</th>
              <th>基本符合</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td rowspan="5" style="width:80px;">{{detailData2[0].reviewItemOne}}</td>
              <td style="width:100px;">{{detailData2[0].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[0].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[0].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[1].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[1].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[1].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[2].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[2].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[2].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[3].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[3].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[3].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[4].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[4].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[4].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td colspan="2">{{detailData2[5].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[5].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[5].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td rowspan="2" style="padding:0 10px;">{{detailData2[6].reviewItemOne}}</td>
              <td>
                <p style="padding:0 10px;text-align:center;">{{detailData2[6].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[6].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[6].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>
                <p
                  style="padding:0 10px;text-align:center;width:120px;"
                >{{detailData2[7].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[7].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[7].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td rowspan="2" style="padding:0 10px;">{{detailData2[8].reviewItemOne}}</td>
              <td>
                <p style="padding:0 10px;text-align:center;">{{detailData2[8].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[8].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[8].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>
                <p style="padding:0 10px;text-align:center;">{{detailData2[9].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[9].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[9].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td rowspan="4" style="padding:0 10px;">{{detailData2[10].reviewItemOne}}</td>
              <td>
                <p
                  style="padding:0 10px;text-align:center;width:120px;"
                >{{detailData2[10].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[10].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[10].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>
                <p style="padding:0 20px;text-align:center;">{{detailData2[11].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[11].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[11].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>
                <p style="padding:0 20px;text-align:center;">{{detailData2[12].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[12].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[12].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>
                <p style="padding:0 20px;text-align:center;">{{detailData2[13].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[13].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[13].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td colspan="2">{{detailData2[14].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[14].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[14].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td colspan="2">{{detailData2[15].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[15].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[15].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td colspan="2">{{detailData2[16].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[16].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[16].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td rowspan="5" style="width:80px;padding:0 10px;">{{detailData2[17].reviewItemOne}}</td>
              <td style="width:100px;">{{detailData2[17].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[17].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[17].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[18].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[18].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[18].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[19].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[19].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[19].selectResult== item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[20].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[20].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[20].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData2[21].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[21].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[21].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td colspan="6">
                <p>注：“＊”代表应急预案的关键要素。</p>
              </td>
            </tr>
            <tr>
              <td colspan="2">评审专家签字</td>
              <td colspan="4" class="sign-word">
                <img v-if="typeof (signImg2)=='string'" :src="signImg2" alt  />
                <img
                  v-else
                  v-for="item in signImg2"
                  :key="item"
                  :src="item"
                  style="margin-right:10px;"
                />
              </td>
            </tr>
          </tbody>
        </table>
        <h2 class="ideaTitle" style="margin-top:10px;">电力企业专项应急预案要素评审表</h2>
        <table class="ideaTable ideaTable1" v-if="detailData2.length>0">
          <thead>
            <tr>
              <th rowspan="2" colspan="2">评审项目</th>
              <th rowspan="2">评审内容及要求</th>
              <th colspan="3">评审意见</th>
            </tr>
            <tr>
              <th>符合</th>
              <th>不符合</th>
              <th>基本符合</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td colspan="2">{{detailData2[22].reviewItemTwo}}</td>
              <td>
                <p>{{detailData2[22].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[22].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td rowspan="2" style="width:80px;padding:0 10px;">{{detailData2[23].reviewItemOne}}</td>
              <td style="width:100px;padding:0 10px;">
                <p style="text-align:center;">{{detailData2[23].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[23].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[23].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td style="width:100px;padding:0 10px;">
                <p style="text-align:center;">{{detailData2[24].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[24].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[24].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td style="width:100px;padding:0 10px;" colspan="2">
                <p style="text-align:center;">{{detailData2[25].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[25].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[25].selectResult  == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td style="width:100px;padding:0 10px;" colspan="2">
                <p style="text-align:center;">{{detailData2[26].reviewItemTwo}}</p>
              </td>
              <td>
                <p>{{detailData2[26].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData2[26].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td colspan="6">
                <p>注 : "*"代表应急预案的关键要素。如果专项应急预案作为综合应急预案的附件,综合应急预案已经明确胡要素,专项应急预案可省略。</p>
              </td>
            </tr>
            <tr>
              <td colspan="2">评审专家签字</td>
              <td colspan="4" class="sign-word">
                <img v-if="typeof (signImg2) =='string'" :src="signImg2" alt  />
                <img
                  v-else
                  v-for="item in signImg2"
                  :key="item"
                  :src="item"
                  alt
                  style="margin-right:10px;"
                />
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </el-dialog>
    <el-dialog title :visible.sync="addFlag" width="80%">
      <div class="ideaMain">
        <h2 class="ideaTitle">电力企业应急预案附件要素评审表</h2>
        <table v-if="detailData3.length > 0" class="ideaTable ideaTable1">
          <thead>
            <tr>
              <th rowspan="2">评审项目</th>
              <th rowspan="2">评审内容及要求</th>
              <th colspan="3">评审意见</th>
            </tr>
            <tr>
              <th>符合</th>
              <th>不符合</th>
              <th>基本符合</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>{{detailData3[0].reviewItemTwo}}</td>
              <td>
                <p>{{detailData3[0].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData3[0].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData3[1].reviewItemTwo}}</td>
              <td>
                <p>{{detailData3[1].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData3[1].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td>{{detailData3[2].reviewItemTwo}}</td>
              <td>
                <p>{{detailData3[2].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData3[2].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td style="width:120px;">{{detailData3[3].reviewItemTwo}}</td>
              <td style="width:300px;">
                <p>{{detailData3[3].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData3[3].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td style="width:120px;">{{detailData3[4].reviewItemTwo}}</td>
              <td style="width:300px;">
                <p>{{detailData3[4].reviewContent}}</p>
              </td>
              <td
                v-for="item in radios"
                :key="item"
                :class="detailData3[4].selectResult == item ? 'div-radio1' : 'div-radio2'"
              ></td>
            </tr>
            <tr>
              <td colspan="5" style="text-align:left;">
                <p>注 : 附件根据应急工作需要动态设置,部分项目可省略。</p>
              </td>
            </tr>
            <tr>
              <td>评审专家签字</td>
              <td colspan="4" class="sign-word">
                <img v-if="typeof signImg3 =='string'" :src="signImg3" />
                <img
                  v-else
                  v-for="item in signImg3"
                  :key="item"
                  :src="item"
                  style="margin-right:10px;"
                />
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import Header from "../common/header2";
import Footer from "../common/footer";
import config from "../../config.js";
export default {
  components: {
    Header,
    Footer
  },
  data() {
    return {
      planCompany: "",
      allFlag1: true,
      allFlag2: true,
      allFlag3: true,
      allFlag4: true,
      ideaPop2: false,
      autograph: "",
      nextFlag: true,
      situationFlag: false,
      keyFlag: false,
      addFlag: false,
      ideaPop: false,
      signImg1: "",
      signImg2: "",
      signImg3: "",
      signImg4: "",
      signImg5: "",
      remark5: "",
      companyName: "",
      consensus: "",
      radios: [1, 2, 3],
      data1: [],
      data2: [],
      data3: [],
      data4: [],
      detailData1: [],
      detailData2: [],
      detailData3: [],
      detailData4: [],
      detailData5: [],
      varname: "",
      suggestAll: ""
    };
  },
  mounted() {
    var arr = [1, 2, 3, 4];
    arr.map(item => {
      this.getData(item);
      this.getAllFlag(item);
    });
    this.varname = localStorage.planname.split(".")[0];
    this.planCompany = localStorage.planCompany;
  },
  methods: {
    goNext() {
      let flag = false;
      var arr = [1, 2, 3, 4];
      arr.map(item => {
        if (this["allFlag" + item]) {
          flag = true;
        }
      });
      if (!flag) {
        this.$router.push("assessedAlls");
      } else {
        this.$message.warning("请汇总所有的评审表");
      }
    },
    getPersonAll() {
      let url = config.baseUrl + "emergency/v1.0/review/search";
      this.$axios
        .post(url, {
          planSummaryId: localStorage.planid,
          reviewType: 4
        })
        .then(res => {
          if (res.data.meta.success) {
            this.companyName = res.data.data.companyName;
            this.detailData5 = res.data.data.list;
            this.signImg5 = res.data.data.photoUrls;
            let arr = [];
            let str = "";
            res.data.data.opinions.map(item => {
              arr.push(JSON.parse(item.photo));
              str += item.opinion + `\n`;
            });
            this.suggestAll = str;
            this.autograph = arr;
            this.detailData5.map(item => {
              if (item.remarks) {
                this.remark5 = item.remarks;
              }
            });
          } else {
            if (res.data.meta.message != "暂无数据") {
              this.$message.warning(res.data.meta.message);
            }
          }
        });
    },
    savePersonAll() {
      if (this.suggestAll == "" || this.consensus == "") {
        this.$message.warning("专家建议不能为空");
      } else {
        let url = config.baseUrl + "emergency/v1.0/review/saveOne";
        let param = {
          consensus: this.consensus,
          opinion: this.suggestAll,
          remarks: this.remark5,
          reviewType: "4",
          autograph: JSON.stringify(this.autograph),
          summaryTemplateName: localStorage.planname,
          planSummaryId: localStorage.planid,
          userId: localStorage.userid
        };
        this.$axios.post(url, param).then(res => {
          if (res.data.meta.success) {
            this.$message.success(res.data.meta.message);
            this.ideaPop = false;
            this.allFlag4 = false;
          } else {
            this.$message.warning(res.data.meta.message);
          }
        });
      }
    },
    goDetailAll(n, flag) {
      if (this["allFlag" + n]) {
        if (n == 4) {
          this.getPersonAll();
          this[flag] = true;
        } else {
          this.reviewSummaryTabel(n, flag);
        }
      }
    },
    goDetail(n, id) {
      switch (n) {
        case "1":
          this.situationFlag = true;
          break;
        case "2":
          this.keyFlag = true;
          break;
        default:
          this.addFlag = true;
          break;
      }
      this.getDetail(n, id);
    },
    getAllFlag(n) {
      let url =
        config.baseUrl +
        "bsReview/v1.0/review/querySummaryType?planSummaryId=" +
        localStorage.planid;
      this.$axios.get(url).then(res => {
        if (res.data.meta.success) {
          if (res.data.data.length > 0) {
            res.data.data.map(item => {
              if (item.reviewType == 1) {
                this.allFlag1 = false;
              }
              if (item.reviewType == 2) {
                this.allFlag2 = false;
              }
              if (item.reviewType == 3) {
                this.allFlag3 = false;
              }
              if (item.reviewType == 4) {
                this.allFlag4 = false;
              }
            });
          }
        } else {
          if (res.data.meta.message != "数据不存在") {
            this.$message.warning(res.data.meta.message);
          }
        }
      });
    },
    bubbleSort(array) {
      var i = 0,
        len = array.length,
        j,
        d;
      for (; i < len; i++) {
        for (j = 0; j < len; j++) {
          if (array[i].intOrder < array[j].intOrder) {
            d = array[j];
            array[j] = array[i];
            array[i] = d;
          }
        }
      }
      return array;
    },
    reviewSummaryTabel(n, flag) {
      let url = config.baseUrl + "bsReview/v1.0/review/reviewSummaryTabel";
      this.$axios
        .post(url, {
          planSummaryId: localStorage.planid,
          reviewTemplateName: localStorage.planname,
          reviewType: n,
          userId: localStorage.userid
        })
        .then(res => {
          if (res.data.meta.success) {
            this["detailData" + n] = this.bubbleSort(res.data.data.list);
            this["signImg" + n] = res.data.data.url;
            this[flag] = true;
            this["allFlag" + n] = false;
          } else {
            if (res.data.meta.message != "暂无数据") {
              this.$message.warning(res.data.meta.message);
            }
          }
        });
    },
    getDetail2(n, id) {
      this.ideaPop2 = true;
      let url = config.baseUrl + "emergency/v1.0/review/info";
      this.$axios
        .post(url, {
          planSummaryId: localStorage.planid,
          tableType: n,
          userId: id
        })
        .then(res => {
          if (res.data.meta.success) {
            this.companyName = res.data.data.companyName;
            this["signImg" + n] = res.data.data.list[0].url;
            this["detailData" + n] = res.data.data.list;
          } else {
            if (res.data.meta.message != "暂无数据") {
              this.$message.warning(res.data.meta.message);
            }
          }
        });
    },
    getDetail(n, id) {
      let url = config.baseUrl + "bsReview/v1.0/review/info?reviewId=" + id;
      this.$axios.get(url).then(res => {
        if (res.data.meta.success) {
          this["signImg" + n] = res.data.data.autograph;
          this["detailData" + n] = res.data.data.list;
        } else {
          if (res.data.meta.message != "暂无数据") {
            this.$message.warning(res.data.meta.message);
          }
        }
      });
    },
    getData(n) {
      let url =
        config.baseUrl +
        "bsReview/v1.0/review/summaryList?planSummaryId=" +
        localStorage.planid +
        "&reviewType=" +
        n;
      this.$axios.get(url).then(res => {
        if (res.data.meta.success) {
          this["data" + n] = res.data.data;
        } else {
          if (res.data.meta.message != "暂无数据") {
            this.$message.warning(res.data.meta.message);
          }
        }
      });
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang='less'>
@import "../../../static/css/assess.less";
td.sign-word {
  img {
    float: left;
  }
  i {
    line-height: 36px;
    background: #edf4fe;
    padding: 0 15px;
    border-radius: 4px;
    color: #4080fe;
    cursor: pointer;
    float: left;
    border: 1px solid #edf4fe;
  }
  i:hover {
    border: 1px solid #4080fe;
  }
}

</style>
